package com.mantru.iotpot.job;

import android.media.MediaPlayer;

import com.mantru.iotpot.ApplicationClass;
import com.mantru.iotpot.R;
import com.mantru.iotpot.modbus.Common;

import org.json.JSONArray;
import org.json.JSONObject;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.IdentityHashMap;
import java.util.Map;
import java.util.TreeMap;

/**
 * 录制炒菜管理器
 */
public class RecordingMaster {
    private ApplicationClass ac;
    //步骤队列，key是从1开始的
    public Map<Integer, RecordSteepEntity> steep_map;
    //UI界面上的几个参数值
    //执行状态，0未执行、1执行中、2已完成、3终止了
    public int steep_status;
    //菜谱名称、份数、重量
    public String vegetable_name;
    public int copies_qty, weight;
    //时长，10位时间截
    public long begin_time, end_time;

    //创建
    public RecordingMaster(ApplicationClass ac, String vegetable_name, int copies_qty, int weight){
        this.ac = ac;
        this.steep_status = 0;  //未执行
        this.vegetable_name = vegetable_name;
        this.copies_qty = copies_qty;
        this.weight = weight;
        steep_map = new HashMap<>();
    }

    //启动
    public void Start() {
        if (this.steep_status != 0)
            return;
        this.steep_status = 1;  //执行中
        this.begin_time = Common.GetTimeStamp10();
    }

    //停止
    public void Stop() {
        if (steep_status != 3) {
            steep_status = 3;  //终止了
            this.end_time = Common.GetTimeStamp10();
        }
    }


}


